import { InjectableObject } from "../../inject";
import { IMediator } from "../base/IMediator";

export class MediatorBase extends InjectableObject implements IMediator {

    protected viewComponent: any;

    protected removed: boolean;

    preRegister(): void {
        this.removed = false;
        this.onRegister();
    }

    onRegister(): void {

    }

    preRemove(): void {
        this.removed = true;
        this.onRemove();
    }

    onRemove(): void {

    }

    getView() {
        return this.viewComponent;
    }

    setView(viewComponent: any): void {
        this.viewComponent = viewComponent;
    }


    listEventTypes(): string[] {
        throw new Error("Method not implemented.");
    }

    handleNotification(event: string, ...args: any[]): void {
        throw new Error("Method not implemented.");
    }

}